// 导入创建好的axios实例
import request from '@/utils/request'

/**
 * 登录接口
 * @param {Object} loginForm
 * @returns Promise
 */
export const loginAPI = (loginForm) => {
  return request({
    method: 'post',
    url: '/sys/login',
    data: loginForm
  })
}

// 获取用户基本信息，得到用户id
export const getUserProfileAPI = () => {
  return request({
    method: 'post',
    url: '/sys/profile'
  })
}

/**
 * 根据员工id获取员工基本信息
 * @param {String} id 员工id
 * @returns Promise
 */
export const getUserInfoAPI = (id) => {
  return request({
    method: 'get',
    url: `/sys/user/${id}`
  })
}
